package com.netcracker.studportal.server.main_test;

import org.json.simple.JSONObject;

import com.netcracker.studportal.server.facade.FacadeAdmin;
import com.netcracker.studportal.server.model.*;
import com.netcracker.studportal.server.util.FacadeUtil;

public class TestFasadeUtil {
	public static void main(String args[]){
		FacadeAdmin fa= new  FacadeAdmin();
		try{
			
		JSONObject obj = new JSONObject();
		obj.put("user_id","1");
		obj.put("type", "aaa");
		obj.put("login","aaaa");
		
		
		User user=FacadeUtil.userParam(obj.toString());
	//	System.out.println("user "+user.kJSON());
		
		JSONObject obj1 = new JSONObject();
		obj1.put("prof_id", "1");
		obj1.put("first_name", "aaa");
		obj1.put("patronymic", "ccc");
		obj1.put("last_name", "vvv");
		obj1.put("birthday", "11.11.2011");
		obj1.put("note", "1");
		obj1.put("univ_id", "1");
	
		Professor prof=FacadeUtil.professorParam(obj1.toString());
	//	System.out.println("prof "+prof.kJSON());
		
		JSONObject obj2 = new JSONObject();
		obj2.put("exam_id", "1");
		obj2.put("subject_id", "1");
		obj2.put("exam_date", "11.11.2011 11:00");
		obj2.put("type", "aaa");
		obj2.put("prof_id", "1");
	
		Exam ex=FacadeUtil.examParam(obj2.toString());
	//	System.out.println("exam "+ex.kJSON());
		
		JSONObject obj3 = new JSONObject();
		obj3.put("exam_id", "1");
		obj3.put("student_id", "1");
		obj3.put("mark", "5");
		obj3.put("note", "note");
	
		ExamWithResult es=FacadeUtil.examWithResultParam(obj3.toString());
		//System.out.println("exam res"+es.kJSON());
		
		JSONObject obj4 = new JSONObject();
		obj4.put("student_id", "1");
		obj4.put("stud_first_name", "1");
		obj4.put("stud_last_name", "2");
		obj4.put("birthday", "11.11.2011");
		obj4.put("course", "1");
		obj4.put("faculty_id", "1");
		obj4.put("group_num", "1");
		obj4.put("note", "note");	
	
		Student stud=FacadeUtil.studentParam(obj4.toString());
	//	System.out.println("stud "+stud.kJSON());
		
		JSONObject obj5 = new JSONObject();
		obj5.put("faculty_id", "1");
		obj5.put("faculty_name", "name");
		obj5.put("univ_id", "1");
	
		Faculty faculty=FacadeUtil.facultyParam(obj5.toString());
	//	System.out.println("faculty "+faculty.kJSON());
		
		JSONObject obj6 = new JSONObject();
		obj6.put("subject_id", "1");
		obj6.put("name", "name");
		obj6.put("hours", "1");
		obj6.put("course", "1");
		obj6.put("description", "desc");
		
		Subject subj=FacadeUtil.subjectyParam(obj6.toString());
	//	System.out.println("subj "+subj.kJSON());
		
		JSONObject obj7 = new JSONObject();
		obj7.put("univ_id", "1");
		obj7.put("univ_name", "1");
		obj7.put("city", "1");
		
		University univ=FacadeUtil.universityParam(obj7.toString());
	//	System.out.println("univ "+univ.kJSON());
		
		JSONObject obj8 = new JSONObject();
		obj8.put("material_id", "1");
		obj8.put("exam_id", "1");
		obj8.put("material_name", "1");
		obj8.put("material_path", "path");

		Material mater=FacadeUtil.materialParam(obj8.toString());
		System.out.println("mater "+mater.kJSON());
				
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
